//
//  BaseController.m
//  callmed
//
//  Created by x x on 2017/9/5.
//  Copyright © 2017年 xx. All rights reserved.
//

#import "BaseController.h"

@interface BaseController ()

@end

@implementation BaseController

#pragma mark - 销毁前调用
- (void)releaseData
{
    DLog(@"%@", NSStringFromClass([self class]));
}

#pragma mark - 关闭之前的页面
- (void)closePreController
{
    if (self.isClosePreController == NO)
    {
        self.isClosePreController = YES;
        
        NSMutableArray *array = [NSMutableArray arrayWithArray:self.navigationController.viewControllers];
        
        for (UIViewController *viewController in array)
        {
            if ([viewController isEqual:self.preCtl])
            {
                [array removeObject:viewController];
                
                break;
            }
        }
        
        self.navigationController.viewControllers = array;
    }
}

#pragma mark - init
- (void)viewWillAppear:(BOOL)animated
{
    [super viewWillAppear:animated];
    
    self.navigationController.interactivePopGestureRecognizer.delegate = self;
}

- (void)viewWillDisappear:(BOOL)animated
{
    [super viewWillDisappear:animated];
    
    self.navigationController.interactivePopGestureRecognizer.delegate = nil;
}

- (void)viewDidLoad
{
    [super viewDidLoad];
    // Do any additional setup after loading the view.

    self.view.backgroundColor = COLOR_VIEW_8;
    
    [self initWithBackButton];
    [self initWithView];
    [self initWithData];
}

- (void)initWithView
{
    
}

- (void)initWithData
{
    
}

@end
